package code;

public class WaterCell extends ContainerCell
{
	private Boolean hasCrate;
	
	@Override
	public String PRINT()
	{
		if (!isEmpty())
			return super.PRINT();
		else if (hasCrate)
			return "O";
		else
			return super.PRINT();
			
	}
	
	public WaterCell(String texture)
	{
		super(texture);
		hasCrate = false;
	}
	
	public void placeObject(MovableObject obj)
	{
		if(!hasCrate)
		{
			if(obj.sinksOnWater())
			{
				hasCrate = true;
			}
			obj.isOnWater();
		}
		else
			super.placeObject(obj);
	}
	
}
